package org.gxuwz.core.service.Impl;

import java.util.List;

import org.gxuwz.core.dao.ICommissureDao;
import org.gxuwz.core.entity.TCommissure;
import org.gxuwz.core.service.ICommissureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository("CommissureService")
public class CommissureService implements ICommissureService{
	@Autowired
	ICommissureDao commDao;

	@Override
	public void addCommissureDao(TCommissure comm) {
		commDao.addCommissureDao(comm);
		
	}

	@Override
	public List<TCommissure> getAll(String comcode, String perscode) {
		return commDao.getAll(comcode, perscode);
	}

	@Override
	public TCommissure getByPersCode(String perscode) {
		return commDao.getByPersCode(perscode);
	}

	@Override
	public TCommissure getcommByPersCode(String perscode) {
		 TCommissure comms=new TCommissure();                
		 TCommissure comm=new TCommissure();
		 comms=commDao.getByPersCode(perscode);
		 if (comms.getPerscode()!=null){
			 comm=commDao.getByPersCode(perscode);
			 //System.out.println(comm.toString()+"kkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
		 }
		 //System.out.println(comm.toString()+"mmmmmmmmmmmmmmmmmmmmmmmmmmmm");
		return comm;
	}
	
	@Override
	public void update(TCommissure comm) {
		commDao.update(comm);		
	}

	@Override
	public void delete(TCommissure comm) {
		commDao.delete(comm);		
	}

	

}
